const countBehavior = Behavior({
  data:{
    last_pose: 0, // 0: up, 1: down
    squat_flag: false,

    max_count: 10,
    my_count: 0,
    last_count: 0,
    timer: null,

    group_count: 0,
    //
    config: {
      canvasSize: {
        width: 240,
        height: 240
      },
      percent: 100,
      barStyle: [{width: 20, fillStyle: '#f0f0f0'}, {width: 20, animate: true, fillStyle: [{position: 0, color: '#56B37F'}, {position: 1, color: '#c0e674'}]}],
      needDot: true,
      dotStyle: [{r: 20, fillStyle: '#ffffff', shadow: 'rgba(0,0,0,.15)'}, {r: 10, fillStyle: '#56B37F'}]
    },
    percentage: 0,
  },
  method:{

  },
  onLoad(options) {
    var that = this

    that.setData({
      max_count: 10
    })
    
    // this.data.timer = setInterval(function(){
    //   if(that.data.my_last_count != that.data.my_count)
    //   {
    //     that.setData({
    //       percentage: that.data.my_count / that.data.max_count * 100,
    //       my_last_count: that.data.my_count
    //     })
    //   }
    // }, 1000);
  },

  onUnload(){
    clearInterval(this.data.timer)
  },


})

export default countBehavior